$(function () {
    //用户名非空验证
    $("#backName").blur(function () {
        var backName = this.value;
        if (backName == null || backName == "") {
            $("#star1").html("用户名不能为空");
        } else {
            $("#star1").html("");
        }
    });
//密码非空验证
    $("#backPassword").blur(function () {
        var backPassword = this.value;
        if (backPassword == null || backPassword == "") {
            $("#star2").html("密码不能为空");
        } else {
            $("#star2").html("")
        }
    });

//    如果用户名或者密码为空，则阻断提交
    var sub = false;
    $("#submit").click(function () {
        var backName = $("#star1").text();
        var backPassword = $("#star2").text();
        if (backName == "" && backPassword == "") {
            sub = true;
        } else {
            sub = false;
        }
        return sub;
    })
})